home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: Bradd W. Szonye <bradds@ix.netcom.com>
- Newsgroups: comp.lang.c++
- Subject: RE: Help for integer multiplication???
- Date: 19 Apr 1996 09:33:04 GMT
- Organization: Netcom
- Message-ID: <01bb2dd3.80300280$c6c2b7c7@Zany.localhost>
- References: <96090.202303IO92118@MAINE.MAINE.EDU> <4jnabd$a5k@news.microsoft.com>
- NNTP-Posting-Host: det-mi6-06.ix.netcom.com
- X-NETCOM-Date: Fri Apr 19 4:33:04 AM CDT 1996
- X-Newsreader: Microsoft Internet News
-
-
- On Sunday, March 31, 1996, Dann Corbit wrote...
- > In article <96090.202303IO92118@MAINE.MAINE.EDU>,
- IO92118@MAINE.MAINE.EDU says...
- > >
- > >Hi:
- > >I want to write a program to do integer multiplication.
- > int int_multiply( int i, int j)
- > {
- > return i*j;
- > }
- >
- > >1101 1110 1010 0001
- > >1010 1101 0010 1010
- > >-------------------
- > >
- > >for normal method, it's time complexity is n square.
- > >
- > >if I devide it into two parts.
- > >2**(n/2)*1101 1110 + 1010 0001
- > >2**(n/2)*1010 1101 + 0010 1010 this is 3**(log(n)) much faster.
- > >-------------------------------
- > >** means to the power. exactly 2**(n/2) mean shift.
- > >
- > >If I want to a program, how to represent 1101 1110 1010 0001 ???
- > >Can I just decimal number or not, or something else???
- > >
- > >Thank you very much!!!
- > I assume you want to look into something more than a simple
- > integer multiply.
- >
- > See "Desigm Strategies for Optimal Multiplier Circuits" by
- > Charles Martel, Vokin Oklobdzija, R. Ravi, Paul F. Sterling
- > in the Proceedings: 12th Symposium on Computer Arithmatic.
- > This is by the IEEE.
-
- Another good source, as always, is Don Knuth's "Art of Computer
- Programming, Volume II: Seminumerical Methods." The book is expensive,
- difficult to read, and 25 years old, but it's still current when it comes
- to doing integer math. In theory, you can actually multiply big enough
- integers in linear time, and Knuth explains how. (Of course the overhead
- is ridiculous, one of those *big* linear constants.)
-
-
-